#include<iostream>
#include<functional>

class Test
{
public:
    Test()
    {
        std::cout<<"构造"<<std::endl;
    }

    ~Test()
    {
        std::cout<<"析构"<<std::endl;
    }
};

void func(Test *t,int num)
{
    std::cout<<num<<std::endl;
    delete t;
}

int main()
{
    Test * t=new Test();

    std::function<void(int)> cb=std::bind(func,t,std::placeholders::_1);
    cb(10);

    return 0;
}